home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d17
/
pgraf110.arc
/
PGRAPH.H
< prev
next >
Wrap
Text File
|
1991-06-21
|
9KB
|
249 lines
/* pgraph.h
Printer Graphics Package.
Copyright (c) F van der Hulst 1991
All Rights Reserved.
Revisions:
27 March 1991: Initial release (Turbo C v2.0 Large model only)
13 April 1991: Ported to MicroSoft C v5.1
16 June 1991: Support for all memory models
*/
#if __STDC__
#define _Cdecl
#else
#define _Cdecl cdecl
#endif
#if !defined(__P_GRAPHX_DEF_)
#define __P_GRAPHX_DEF_
#if !defined(__GRAPHX_DEF_)
enum graphics_errors { /* graphresult error return codes */
grOk = 0,
grNoInitGraph = -1,
grNotDetected = -2,
grFileNotFound = -3,
grInvalidDriver = -4,
grNoLoadMem = -5,
grNoScanMem = -6,
grNoFloodMem = -7,
grFontNotFound = -8,
grNoFontMem = -9,
grInvalidMode = -10,
grError = -11, /* generic error */
grIOerror = -12,
grInvalidFont = -13,
grInvalidFontNum = -14,
grInvalidVersion = -18
};
enum line_styles { /* Line styles for get/setlinestyle */
SOLID_LINE = 0,
DOTTED_LINE = 1,
CENTER_LINE = 2,
DASHED_LINE = 3,
USERBIT_LINE = 4, /* User defined line style */
};
enum line_widths { /* Line widths for get/setlinestyle */
NORM_WIDTH = 1,
THICK_WIDTH = 3,
};
enum font_names {
DEFAULT_FONT = 0, /* 8x8 bit mapped font */
TRIPLEX_FONT = 1, /* "Stroked" fonts */
SMALL_FONT = 2,
SANS_SERIF_FONT = 3,
GOTHIC_FONT = 4,
SCRIPT_FONT = 5,
SIMPLEX_FONT = 6,
TRI_SCR_FONT = 7,
COMPLEX_FONT = 8,
EURO_FONT = 9,
BOLD_FONT = 10
};
#define HORIZ_DIR 0 /* left to right */
#define VERT_DIR 1 /* bottom to top */
#define USER_CHAR_SIZE 0 /* user-defined char size */
enum fill_patterns { /* Fill patterns for get/setfillstyle */
EMPTY_FILL, /* fills area in background color */
SOLID_FILL, /* fills area in solid fill color */
LINE_FILL, /* --- fill */
LTSLASH_FILL, /* /// fill */
SLASH_FILL, /* /// fill with thick lines */
BKSLASH_FILL, /* \\\ fill with thick lines */
LTBKSLASH_FILL, /* \\\ fill */
HATCH_FILL, /* light hatch fill */
XHATCH_FILL, /* heavy cross hatch fill */
INTERLEAVE_FILL, /* interleaving line fill */
WIDE_DOT_FILL, /* Widely spaced dot fill */
CLOSE_DOT_FILL, /* Closely spaced dot fill */
USER_FILL /* user defined fill */
};
enum putimage_ops { /* BitBlt operators for putimage */
COPY_PUT, /* MOV */
XOR_PUT, /* XOR */
OR_PUT, /* OR */
AND_PUT, /* AND */
NOT_PUT /* NOT */
};
enum text_just { /* Horizontal and vertical justification
for settextjustify */
LEFT_TEXT = 0,
CENTER_TEXT = 1,
RIGHT_TEXT = 2,
BOTTOM_TEXT = 0,
/* CENTER_TEXT = 1, already defined above */
TOP_TEXT = 2
};
struct linesettingstype {
int linestyle;
unsigned upattern;
int thickness;
};
struct textsettingstype {
int font;
int direction;
int charsize;
int horiz;
int vert;
};
struct fillsettingstype {
int pattern;
int color;
};
struct pointtype {
int x, y;
};
struct viewporttype {
int left, top, right, bottom;
int clip;
};
struct arccoordstype {
int x, y;
int xstart, ystart, xend, yend;
};
#endif
enum p_graphics_drivers { /* define graphics drivers */
STAR = 1,
LASERJET,
LX400,
USER1,
USER2,
};
enum p_graphics_modes { /* graphics modes for each driver */
STAR_60_72 = 0, /* Star NX-10 60 dpi * 72 dpi Normal */
STAR_120_216, /* 120 * 216 Double */
STAR_120_108, /* 120 * 108 Double */
STAR_120_72, /* 120 * 72 Double, fast */
STAR_240_216, /* 240 * 216 Quad */
STAR_80_72, /* 80 * 72 CRT graphics */
STAR_72_72, /* 72 * 72 Plotter */
STAR_90_72, /* 90 * 72 CRT II */
LJ_75_75 = 0, /* HP LaserJet 75 dpi * 75 dpi */
LJ_100_100, /* 100 * 100 */
LJ_150_150, /* 150 * 150 */
LJ_300_300, /* 300 * 300 */
LX400_60_72 = 0, /* Epson LX-400 60 dpi * 72 dpi Normal */
LX400_120_216, /* 120 * 216 Double */
LX400_120_108, /* 120 * 108 Double */
LX400_120_72, /* 120 * 72 Double, fast */
LX400_240_216, /* 240 * 216 Quad */
LX400_40_72, /* 40 * 72 CRT graphics */
LX400_80_72, /* 80 * 72 Plotter */
LX400_90_72, /* 90 * 72 CRT II */
};
void far _Cdecl p_arc(int x, int y, int stangle, int endangle, int radius);
void far _Cdecl p_circle(int x, int y, int radius);
void far _Cdecl p_drawpoly(int numpoints, int far *polypoints);
void far _Cdecl p_ellipse(int x, int y, int stangle, int endangle, int xradius, int yradius);
void far _Cdecl p_fillellipse( int x, int y, int xradius, int yradius );
void far _Cdecl p_fillpoly(int numpoints, int far *polypoints);
void far _Cdecl p_floodfill(int x, int y, int border);
void far _Cdecl p_getresolution(int far *xres, int far *yres);
void far _Cdecl p_getaspectratio(int far *xasp, int far *yasp);
void far _Cdecl p_setaspectratio(int xasp, int yasp);
int far _Cdecl p_getmaxx(void);
int far _Cdecl p_getmaxy(void);
int far _Cdecl p_getx(void);
int far _Cdecl p_gety(void);
void far _Cdecl p_line(int x1, int y1, int x2, int y2);
void far _Cdecl p_linerel(int dx, int dy);
void far _Cdecl p_lineto(int x, int y);
void far _Cdecl p_moverel(int dx, int dy);
void far _Cdecl p_moveto(int x, int y);
void far _Cdecl p_putpixel(int x, int y, int colour);
void far _Cdecl _p_putpixel_screen(int x, int y, int colour);
void far _Cdecl p_rectangle(int left, int top, int right, int bottom);
void far _Cdecl p_closegraph(void);
int far _Cdecl p_getmaxcolor(void);
void far _Cdecl p_setlinestyle(int linestyle, unsigned upattern, int thickness);
void far _Cdecl p_outtext(char far *textstring);
void far _Cdecl p_outtextxy(int x, int y, char far *textstring);
void far _Cdecl p_cleardevice(void);
void far _Cdecl p_setwritemode(int mode);
void far _Cdecl p_print(int out_dev);
void far _Cdecl p_view(void);
void far _Cdecl p_graphdefaults(void);
int far _Cdecl p_graphresult(void);
unsigned far _Cdecl p_getpixel(int x, int y);
void far _Cdecl p_setcolor(int color);
int far _Cdecl p_getcolor(void);
void far _Cdecl p_bar3d(int left, int top, int right, int bottom, int depth, int topflag);
void far _Cdecl p_bar(int left, int top, int right, int bottom);
void far _Cdecl p_settextstyle(int font, int direction, int charsize);
void far _Cdecl p_settextjustify(int horiz, int vert);
void far _Cdecl p_gettextsettings(struct textsettingstype far *texttypeinfo);
void far _Cdecl p_setusercharsize(int multx, int divx, int multy, int divy);
int far _Cdecl p_textwidth(char far *string);
int far _Cdecl p_textheight(char far *string);
void far _Cdecl p_getlinesettings(struct linesettingstype far *linetypeinfo);
char far* far _Cdecl p_getdrivername(void);
void far _Cdecl p_getfillpattern(char far *pattern);
void far _Cdecl p_getfillsettings(struct fillsettingstype far *fillinfo);
void far _Cdecl p_setfillpattern(char far *upattern, int colour);
void far _Cdecl p_setfillstyle(int pattern, int colour);
void far _Cdecl p_getimage(int left, int top, int right, int bottom, void far *bitmap);
unsigned far _Cdecl p_imagesize(int left, int top, int right, int bottom);
void far _Cdecl p_putimage(int left, int top, void far *bitmap, int op);
void far _Cdecl p_pieslice(int x, int y, int stangle, int endangle, int radius);
void far _Cdecl p_sector( int X, int Y, int StAngle, int EndAngle, int XRadius, int YRadius);
int far _Cdecl p_registerbgifont(void (*font)(void));
int far _Cdecl p_registerfarbgifont(void far *font);
void far _Cdecl p_clearviewport(void);
int far _Cdecl p_getgraphmode(void);
int far _Cdecl p_getmaxmode(void);
char far* far _Cdecl p_getmodename(int mode_number);
void far _Cdecl p_getmoderange(int graphdriver, int far *lomode, int far *himode);
void far _Cdecl p_initgraph(int far *graphdriver, int far *graphmode, char far *pathtodriver);
void far _Cdecl p_setgraphmode(int mode);
void far _Cdecl p_setviewport(int left, int top, int right, int bottom, int clip);
int far _Cdecl p_registerbgidriver(void (*driver)(void));
int far _Cdecl p_registerfarbgidriver(void far *driver);
void far _Cdecl p_getarccoords(struct arccoordstype far *arccoords);
void far _Cdecl _p_graphfreemem(void far *ptr, unsigned long size);
void far * far _Cdecl _p_graphgetmem(unsigned long size);
void far _Cdecl p_dump(void);
#endif